<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'main.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="easyui/themes/default/easyui.css"
	type="text/css"></link>
	<link rel="stylesheet" href="easyui/themes/icon.css" type="text/css"></link>
	<script type="text/javascript" src="easyui/jquery.min.js"></script>
	<script type="text/javascript" src="easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="easyui/locale/easyui-lang-zh_CN.js"></script>
	
	<!-- ztree的js和css -->
  <link rel="stylesheet" type="text/css" href="ztree/css/zTreeStyle/zTreeStyle.css">
  <script type="text/javascript" src="ztree/js/jquery.ztree.core.js"></script>
  <script type="text/javascript" src="ztree/js/jquery.ztree.excheck.js"></script>
  <script type="text/javascript" src="ztree/js/jquery.ztree.exedit.js"></script>
  
  <style type="text/css">  
        /**最新动态 样式*/  
        .news{width:200px;border:1px solid #AAAAAA; margin:10px;}  
        .scrollNews{width:200px;height:185px;line-height:20px;overflow:hidden;background:#FFFFFF;}  
        h3{ height:26px; background:#3B5998;color:#FFF; line-height:26px; text-indent:6px;}  
        .scrollNews li{height:20px; padding-left:10px;}  
    </style>  
  
  <script type="text/javascript">
  		/**************************ztree************************************/
  		 //设置ztree标题的颜色
		 function setFontCss(treeId, treeNode) {  
	            return treeNode.level == 1 ? {color:"red"} : {};  
	     };  
	     
	     var setting = {  
	             //  check: {  
	             //     enable: true//启动多选框记得导入jquery.ztree.excheck-3.4.js   
	             // },  
	                 
	               data: {  
	                   simpleData: {  
	                       enable: true,//如果设置为 true，请务必设置 setting.data.simpleData 内的其他参数: idKey / pIdKey / rootPId，并且让数据满足父子关系。  
	                       idKey: "id",  
	                       pIdKey: "pid",  
	                       rootPId: 0  
	                   },
	                   key: {
	           			name: "title",
	           			url:""
	           		}

	               },  
	                             
	                 
	               view: {  
	                   showLine: false,//显示连接线  
	                   showIcon: true,//显示节点图片  
	                   //fontCss: {color:"red"}  
	                   fontCss: setFontCss//节点颜色  
	               },  
	                 
	               async: {    //ztree异步请求数据  
	                   enable: true,  
	                   url: "show_Menu.action",//请求action方法  
	                   autoparam:["id"]  
	               },
	               callback:{
		               	beforeClick: zTreeBeforeClick,
		               	onAsyncSuccess: zTreeOnAsyncSuccess

	               }
	           };  
	     
			//启动树节点	     
	     	$(function($){  
	          
	            $.fn.zTree.init($("#treeDemo"), setting);  
	        }); 
			
			function zTreeOnAsyncSuccess(){
				//alert('加载树成功');
				var treeObj = $.fn.zTree.getZTreeObj("treeDemo");
				treeObj.expandAll(true);

			}

	      	function showPanel(stitle,urlpath){  
	      		//alert(urlpath); 子节点请求路径		
	      		if($('#ttab').tabs('exists',stitle)){
	      			$('#ttab').tabs('select',stitle);
	      		}else{
	      			$('#ttab').tabs('add',{    
	    	  		    title:stitle,    
	    	  		    content:'<iframe src='+urlpath+' scrolling=no frameborder=0 height=100% width=100% marginheight=0 marginwidth=0/>',    
	    	  		    closable:true
	    	  		}); 
	      		}

	      	}
	      	
	      	//树节点的点击事件
	      	function zTreeBeforeClick(treeId, treeNode, clickFlag) {
	      		//alert("treeNode.id--->"+treeNode.id);
	      		//alert("treeNode.url--->"+treeNode.url);
	      		//alert("treeNode.name--->"+treeNode.title);
	      		if(treeNode.url !== ''){//不新建标签页面显示,让页面显示在中心区域
	      			showPanel(treeNode.title,treeNode.url);
	      		}
	      			
	        	return (treeNode.id !== 1);
	    	};
  		/*******************************************************************/
  </script>
  </head>
  
   <body class="easyui-layout">   
    <div data-options="region:'north',title:'',split:true" style="height:120px;">
    	<img src="image/banner1.jpg" height="96px" width="100%"></img><br>
    	<div align="right">当前登录用户:${nus.uname} <a href="login.jsp">退出登录</a></div>
    </div>   
    <div data-options="region:'south',title:'',split:true" style="height:50px;">
    	<hr/>
    	<div align="center">copy@right 西安巨林科技有限公司版权所有</div>
    </div>   
    <div data-options="region:'east',iconCls:'icon-reload',border:true,title:'新闻列表',split:true,collapsible:true" style="width:240px;">
    	<!--最新动态开始-->  
			<div class="news">  
			    <h3>最新动态</h3>  
			    <div class="scrollNews" >  
			        <ul>  
			            <li><a href="#" title="甜美宽松毛衣今秋一定红.">甜美宽松毛衣今秋一定红.</a></li>  
			            <li><a href="#" title="秋装百搭小马甲不到50元.">秋装百搭小马甲不到50元.</a></li>  
			            <li><a href="#" title="修身韩版小西装万人疯抢.">修身韩版小西装万人疯抢.</a></li>  
			            <li><a href="#" title="夏末雪纺店主含泪大甩卖.">夏末雪纺店主含泪大甩卖.</a></li>  
			            <li><a href="#" title="瑞丽都疯狂推荐的秋装.">瑞丽都疯狂推荐的秋装.</a></li>  
			            <li><a href="#" title="48元长款针织小开衫卖疯啦.">48元长款针织小开衫卖疯啦.</a></li>  
			            <li><a href="#" title="长袖雪纺衫单穿内搭都超美.">长袖雪纺衫单穿内搭都超美.</a></li>  
			            <li><a href="#" title="你这样让单身的怎么敢找对象_新闻_腾讯网">你这样让单身的怎么敢找对象.</a></li>  
			            <li><a href="#" title="新闻哥吐槽 腾讯新闻哥晚间吐槽 午间版晚间版_我爱热可乐">新闻哥吐槽 腾讯新闻哥晚间吐槽.</a></li>  
			            <li><a href="#" title="习近平在上合组织成员国元首理事会讲话
李克强为何从小小汽车底盘说起？">习近平在上合组织成员国元..
李克强为何从小小汽车..？</a></li>  
			        </ul>  
			    </div>  
			</div>  
		<!--最新动态结束-->  
    </div>   
    <div data-options="region:'west',title:'人力资源管理系统',split:true" style="width:150px;">
    	 <div class="content_wrap">
            <div class="zTreeDemoBackground left">
                <ul id="treeDemo" class="ztree"></ul>
            </div>
		</div>
    </div>   
    <div id="mycent" data-options="region:'center',title:''" style="padding:5px;background:#eee;">
    	<!-- 标签页布局 -->
    	<div id="ttab" class="easyui-tabs" style="width:'fit';height:450px;">   
		    
		</div>  
    	
    
    </div>   
</body>
<script>
/*新闻滚动*/  
$(function() {  
    var $this = $(".scrollNews");  
    var scrollTimer;  
    $this.hover(function() {  
        clearInterval(scrollTimer);  
    }, function() {  
        scrollTimer = setInterval(function() {  
            scrollNews($this);  
        }, 3000);  
    }).trigger("mouseleave");  
});  
function scrollNews(obj) {  
    var $self = obj.find("ul:first");  
    var lineHeight = $self.find("li:first").height(); //获取行高  
    $self.animate({ "marginTop": -lineHeight + "px" }, 600, function() {  
        $self.css({ marginTop: 0 }).find("li:first").appendTo($self); //appendTo能直接移动元素  
    })  
}  
</script>  
</html>
